<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<html>
	<head>
		<%@ include file="/common/common.jsp"%>
		<script type="text/javascript">
		  function inits(){
			document.getElementById("user.deptId").value=${user.deptId};
		  }
		</script>
	</head>

	<body onload="inits();">
		<table class="navigation">
			<tr>
				<td class="location">
					<web:location value="用户管理-修改用户" />
				</td>
				<td class="back">
					<web:back url="user!listUser.action" />
				</td>
			</tr>
		</table>
		<div class="form-content">
			<form id="_form" class="form"
				action="${path}/um/user!updateUser.action" method="post">
				<web:transfer />
				<table>
				<tr>
					<td class="label">
						<label>
							所属部门：
						</label>
					</td>
					<td>
					  <select name="user.deptId" id="user.deptId" style="width: 152px;">
					    <c:forEach items="${user.deptList}" var="dept1" varStatus="status">
						  <c:if test="${dept1.deptLevel==1}">
							<option value="${dept1.id}">${dept1.deptName}</option>
							<c:forEach items="${user.deptList}" var="dept2" varStatus="status">
						      <c:if test="${dept2.deptLevel==2 && dept2.parentId==dept1.id}">
								<option value="${dept2.id}">&nbsp;&nbsp;${dept2.deptName}</option>
								<c:forEach items="${user.deptList}" var="dept3" varStatus="status">
							      <c:if test="${dept3.deptLevel==3 && dept3.parentId==dept2.id}">
									<option value="${dept3.id}">&nbsp;&nbsp;&nbsp;&nbsp;${dept3.deptName}</option>
									<c:forEach items="${user.deptList}" var="dept4" varStatus="status">
								      <c:if test="${dept3.deptLevel==4 && dept4.parentId==dept3.id}">
										<option value="${dept4.id}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${dept4.deptName}</option>
									  </c:if>
									</c:forEach>
								  </c:if>
								</c:forEach>
							  </c:if>
							</c:forEach>
						  </c:if>
						</c:forEach>
					  </select>
					</td>
				  </tr>
				  <tr>
						<td class="label">
							<label>
								登录名：
							</label>
						</td>
						<td>
							<input type="text" value="${user.accountName}"
								disabled="disabled">
						</td>
					</tr>
					<tr>
						<td class="label">
							<label>
								<font class="star">*</font>用户姓名：
							</label>
						</td>
						<td>
							<input type="text" name="user.userName"
								value="${user.userName}">
						</td>
					</tr>
					<tr>
						<td class="label">
							<label>
								<font class="star">*</font>用户口令：
							</label>
						</td>
						<td>
							<input type="password" name="user.password"
								value="${user.password}" style="width: 275px;">
						</td>
					</tr>
					
					<tr>
						<td class="label">
							<label>
								联系电话：
							</label>
						</td>
						<td>
							<input type="text" name="user.mobile" value="${user.mobile}" maxlength="30">
						</td>
					</tr>
					<!-- 
						<tr>
							<td>
								<label>
									角色：
								</label>
							</td>
							<td>
								<web:select name="roles" items="${roleList}" value="${roleIds}"
									style="width:275px;" multiple="multiple" size="15" />
							</td>
						</tr>
					  -->
					<tr>
						<td class="label">
							<label>
								是否启用：
							</label>
						</td>
						<td>
							<web:yesNoSelect name="user.isEnable" value="${user.isEnable}"
								style="width:275px;" aliasYes="启用" aliasNo="停用" />
						</td>
					</tr>

					<tr>
						<td colspan="2" align="center">
							<input type="button" class="button" value="保 存"
								onclick="submitForm(this.form)" />
							<input type="reset" class="button" value="重置" />
						</td>
					</tr>
				</table>
				<input type="hidden" name="user.id" value="${user.id }">
			</form>
		</div>
	</body>
</html>
